package com.gjw.strategy;

import com.gjw.planeWar.Bullet;
import com.gjw.planeWar.HeroPlane;

/**
 * @author gjw19
 * @date 2019/5/18
 */
public class ThreeFireStrategy implements FireStrategy {
    @Override
    public void fire(HeroPlane heroPlane) {
        int bX1 = heroPlane.getX() - Bullet.WIDTH / 2;
        int bY1 = heroPlane.getY() + HeroPlane.WIDTH / 2 - Bullet.HEIGHT / 2;
        new Bullet(bX1, bY1);
        int bX2 = heroPlane.getX() + HeroPlane.WIDTH / 2 - Bullet.WIDTH / 2;
        int bY2 = heroPlane.getY() - Bullet.HEIGHT;
        new Bullet(bX2, bY2);
        int bX3 = heroPlane.getX() + HeroPlane.WIDTH - Bullet.WIDTH / 2;
        int bY3 = heroPlane.getY() + HeroPlane.WIDTH / 2 - Bullet.HEIGHT / 2;
        new Bullet(bX3, bY3);
    }
}
